package cn.pn.project.client.base;

import cn.pn.project.pojo.base.City;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name="pn-base-provider")
public interface CityFeign {
    /**
     * 查询城市集合
     * @return
     * @throws Exception
     */
    @RequestMapping(value="/city/mapCity",method = RequestMethod.POST)
    Map<String,List<City>> mapCity() throws Exception;

    /**
     * 根据城市id查询城市对象
     * @param cityId
     * @return
     * @throws Exception
     */
    @RequestMapping("/city/byCityId")
    City getCityById(@RequestParam("cityId") Integer cityId) throws Exception;
}